package cn.edu.nju.software.cdiy.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import cn.edu.nju.software.cdiy.bean.Admin;
import cn.edu.nju.software.cdiy.bean.Supplier;
import cn.edu.nju.software.cdiy.bean.Uorder;
import cn.edu.nju.software.cdiy.bean.Value;
import cn.edu.nju.software.cdiy.dao.AdminDao;
import cn.edu.nju.software.cdiy.dao.SupplierDao;
import cn.edu.nju.software.cdiy.service.AdminService;

public class AdminServiceImpl implements AdminService {

	@Autowired
	private AdminDao adminDao;
	@Autowired
	private SupplierDao supplierDao;

	public void setAdminDao(AdminDao adminDao) {
		this.adminDao = adminDao;
	}

	public void setSupplierDao(SupplierDao supplierDao) {
		this.supplierDao = supplierDao;
	}
	
	@Override
	public Admin login(String signInName, String password) {
		return this.adminDao.login(signInName, password);
	}	

	@Override
	public void updateAdmin(Admin admin) {
		this.adminDao.updateAdmin(admin);
	}

	@Override
	public Admin registor(Admin admin) {
		return this.adminDao.updateRegistor(admin);
	}

	@Override
	public void setState(Uorder u, Value state) {
		
	}

	@Override
	public List<Supplier> getSupplierList() {
		return this.supplierDao.getAllSupplier();
	}

}
